<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="this.style.display='none'">
    点我后我就消失了
</button>
<script>
    var bar = 2;
    var obj = {
        foo: function () { console.log(this.bar) },
        bar: 1
    };
    var foo = obj.foo;
    obj.foo() // 1
    foo() //
</script>
</body>
</html>